<?php

namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;
use Traits\Response;

class Controller extends BaseController
{
    use AuthorizesRequests, DispatchesJobs, ValidatesRequests, Response;

    /**
     * 使用 Admin 鉴权
     * 
     * 在构造函数中使用该方法后,除了 except 指定的方法外,任何方法访问都需要进行管理鉴权
     * 
     * @param array $except 无需鉴权的方法
     */
    protected function useAuth($except = ['index', 'show', 'edit', 'create'])
    {
        $this->middleware('admin.auth')->except($except);
    }
    
}
